﻿using System;
using System.IO;

namespace ConsoleApp1.demo;

// 文件暂时测不通，以后再研究

public class p16_file
{
    public static void Test()
    {
        FileStream F = new FileStream("E:\\Projects\\CsProjects\\cs_demo\\test.dat", 
            FileMode.OpenOrCreate, FileAccess.ReadWrite);

        for (int i = 1; i <= 20; i++)
        {
            F.WriteByte((byte)i);
        }
        F.Position = 0;
        for (int i = 0; i <= 20; i++)
        {
            Console.Write(F.ReadByte() + " ");
        }
        F.Close();
    }
}